package com.handtransaction.dao;

import com.handtransaction.entity.Demand;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface DemandDao {





    //根据id查找需求
    @Select("SELECT* FROM demand WHERE did=#{did}")
    public Demand queryDemandByid(Integer did );

    //根据类别查找
    @Select("SELECT* FROM demand WHERE dcid=#{dcid}")
    public  List<Demand> queryDemandBydcid(String dcid);

    //查找全部需求
    @Select("SELECT* FROM demand ")
    public List<Demand> queryDemand();

    //根据关键字查找需求（模糊查询）
    @Select("SELECT* FROM demand " + "WHERE dname LIKE #{dmessage} or ddetail like #{dmessage}")
    public List<Demand> queryDemandBydm(String dmessage);
}
